//
//  UIColor+Extension.swift
//  gamlify
//
//  Created by Admin on 2024/12/8.
//

import UIKit

extension UIColor {
    // 16进制颜色
    static func hex(_ hex: Int, alpha: CGFloat = 1.0) -> UIColor {
        return UIColor(
            red: CGFloat((hex & 0xFF0000) >> 16) / 255.0,
            green: CGFloat((hex & 0x00FF00) >> 8) / 255.0,
            blue: CGFloat(hex & 0x0000FF) / 255.0,
            alpha: alpha
        )
    }
}
